package com.zxt.content.user.req;

import com.zxt.content.user.valid.LoginGroup;
import com.zxt.content.user.valid.RegisterGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author zxt
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@ApiModel("用户注册/登录对象入参")
public class LoginBodyDTO {

    /**
     * 用户名
     */
    @ApiModelProperty("用户名")
    @NotNull(message = "用户名不能为空", groups = {RegisterGroup.class, LoginGroup.class})
    @Size(max = 11, message = "用户名最多可设置11位", groups = RegisterGroup.class)
    private String username;

    /**
     * 用户密码
     */
    @NotNull(message = "密码不能为空", groups = {RegisterGroup.class, LoginGroup.class})
    @Size(max = 11, message = "密码最多可设置11位", groups = RegisterGroup.class)
    private String password;

    /**
     * 验证码
     */
    @NotNull(message = "验证码不能为空", groups = {RegisterGroup.class})
    private String code;

    /**
     * 唯一标识
     */
    @NotNull(message = "标识不能为空", groups = {RegisterGroup.class})
    private String uuid = "";

}
